#ifndef DRAWABLESPRITE_H
#define DRAWABLESPRITE_H

#include <drawables/drawable.hpp>
#include <resource_cache/resource_cache.hpp>

class sprite : public drawable
{
public:
	virtual bool draw( float x = 0, float y = 0, float rotation = 0, float scale = 1 );
	sprite( const std::string & filepath, float x = 0, float y = 0, float rot = 0, float scale = 1 );
	sprite() : drawable(), m_flip_horizontal(false) { }
	bool	fill( const std::string & filepath, float x = 0, float y = 0, float rot = 0, float scale = 1 );

	void	set_rect( sf::IntRect sub_rect ) { m_sub_rect = sub_rect; }
	void	flip_horizontal( bool flip ) { m_flip_horizontal = flip; }
	virtual sf::IntRect const & size( ) const
	{
		return m_sub_rect;
	}

protected:
	sf::Sprite m_sprite;
	sf::IntRect m_sub_rect;
	bool		m_flip_horizontal;

};

#endif
